package dk.pun.dums.client.presenter;

import com.google.gwt.user.client.ui.HasWidgets;

import dk.pun.dums.client.view.SplashView;
import dk.pun.dums.client.view.TopBarView;

public class SplashPresenter implements Presenter, SplashView.Presenter {

	private final transient SplashView view;

	public SplashPresenter(final SplashView view, final String signInURL) {
		this.view = view;
		if (this.view != null) {
			final TopBarView topBarView = this.view.getTopBarView();
			final TopBarPresenter topBarPresenter = new TopBarPresenter(topBarView);
			topBarPresenter.setSignedOut(signInURL);
		}
	}

	@Override
	public void go(final HasWidgets container) {
		container.clear();
		container.add(this.view.asWidget());
	}

}
